<template>
  <div class="wage-set-rule-detail-wrapper page-miH page-bgBack">
    <a-row class="head">
      <div style="cursor:pointer">
        <a-icon type="left" @click="goDetail" />
        <div class="left2" @click="goDetail">返回</div>
      </div>
      <a-col class="title">
        <strong>计税规则详情</strong>
      </a-col>
    </a-row>
    <div class="rule-item-wrapper">
      <div class="rule-item">
        <span class="rule-item-title">方案名称</span>
        <span class="rule-item-value">{{ dataDetail.name }}</span>
      </div>
      <div class="rule-item">
        <span class="rule-item-title">个税类型</span>
        <span class="rule-item-value">{{ taxRule[dataDetail.type - 1] }}</span>
      </div>
      <div class="rule-item">
        <span class="rule-item-title">描述</span>
        <span class="rule-item-value">{{ dataDetail.description }}</span>
      </div>
      <div class="rule-item">
        <span class="rule-item-title">是否计税</span>
        <span class="rule-item-value">{{ dataDetail.isCalculate ? "是" : "否" }}</span>
      </div>
      <div class="rule-item">
        <span class="rule-item-title">起征点</span>
        <span class="rule-item-value">{{ dataDetail.threshold === 0 ? "-" : `${dataDetail.threshold}/月` }}</span>
      </div>
      <div class="rule-item">
        <span class="rule-item-title">个税结果</span>
        <span class="rule-item-value">{{ dataDetail.type === 3 ? "-" : dataDetail.taxResult }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { getdetail } from "@/api/wages/set";
const taxRule = ["工资薪金所得", "劳动报酬所得", "不计税"];
export default {
  data() {
    return {
      dataDetail: {},
      taxRule
    };
  },

  created() {
    this.init();
  },

  methods: {
    goDetail() {
      this.$router.push({
        path: "/wages/set",
        query: {
          tabs: "1"
        }
      });
    },
    init() {
      const taxRuleId = this.$route.query.taxRuleId;
      getdetail(taxRuleId)
        .then(res => {
          this.dataDetail = res.data;
        })
        .catch(err => {
          console.log("debug log --> ", err);
        });
    }
  }
};
</script>

<style scoped lang="scss">
.wage-set-rule-detail-wrapper {
  .head {
    .anticon-left {
      z-index: 3;
      left: 27px;
      position: absolute;
      color: #d8d8d8;
      font-size: 20px;
      margin-top: 21px;
    }
    .left2 {
      z-index: 3;
      left: 50px;
      position: absolute;
      color: #595959;
      font-size: 16px;
    }
    font-size: 16px;
    color: #000;
    font-weight: 500;
    text-align: center;
    line-height: 60px;
    height: 60px;
    border-bottom: 1px solid #e8e8e8;
  }
  .rule-item-wrapper {
    margin-top: 40px;
    .rule-item {
      margin-bottom: 20px;
      margin-left: 50px;
      .rule-item-title {
        font-size: 14px;
        color: #7b7b7b;
        margin-right: 80px;
        width: 80px;
        display: inline-block;
      }
      .rule-item-value {
        font-size: 14px;
        color: #252525;
      }
    }
  }
}
</style>
